
pub struct User{
    name: String,
    age: u8,
    gender:Gender
}

impl User {
    pub fn create(name:String, age: u8, gender:Gender) -> Self{
        User{
            name,age,gender
        }
    }
    pub fn get_name(&self) -> &String {
        &self.name
    }
    pub fn get_age(&self) -> u8{
        self.age
    }
    pub fn get_gender(&self) -> &Gender {
        &self.gender
    }

    pub fn to_string(&self) -> String{
        String::from(format!("name:{}, age:{},gender:{}",self.name,self.age,self.gender.to_string()))
    }
}

pub enum Gender{
    MALE,
    FEMALE
}
impl Gender {
    pub fn to_string(&self)-> String{
        match self {
            Gender::FEMALE=>String::from("FEMALE"),
            Gender::MALE=>String::from("MALE"),
        }
    }
}